/**
 *添加菜单
 */
'use strict';

const conn = require('../../libs/DB/Conn');
const _ = require('underscore');
module.exports = async function (params) {
    let checkRepeatMenuSql = `SELECT label,menu_path FROM sys_menu`;
    let parentId = params.parentId;
    let menuPath = params.path;
    let label = params.label;
    let menuType = params.sysMenuType;
    let insertMenuSql = `INSERT INTO sys_menu SET ?`,
        insertMenuObj = {
            label: label,
            menu_path: menuPath,
            parent_id: parentId,
            menu_type: menuType
        };
    await conn(insertMenuSql, [insertMenuObj]);
    return { success: true };
};
